<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 对象字面量增强
    const bar = "bar"
    const age = "age"
    const obj = {
      name: "tom",
      // bar: bar
      bar,
      sayHi () {
        console.log('hi')
        console.log(this)
      },
      // 计算属性名
      [1+2]: 18
    }
    // obj[age] = 18
    console.log(obj)
    // obj.sayHi()

   
  </script>
</body>
</html>